<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <title>系统设置</title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="stylesheet" href="<?php echo base_url();?>views/static/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="<?php echo base_url();?>views/static/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="<?php echo base_url();?>views/static/ionicons/css/ionicons.min.css">

    <link rel="stylesheet" href="<?php echo base_url();?>views/static/dist/css/AdminLTE.css">
    <link rel="stylesheet" href="<?php echo base_url();?>views/static/dist/css/skins/_all-skins.css">

    <link rel="stylesheet" href="<?php echo base_url();?>views/static/css/my_style.css">

    <link rel="stylesheet" href="<?php echo base_url();?>views/static/plugins/bootstrapvalidator/css/bootstrapValidator.css">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
  <script src="//cdn.bootcss.com/html5shiv/3.7.3/html5shiv.js"></script>
  <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
  <![endif]-->
</head>
<body class="hold-transition skin-blue">
<!-- Site wrapper -->
<div class="wrapper">

  <!-- main -->
  <div class="content-wrapper" style="margin: 0;">

      <!-- page title -->
    <section class="content-header">
      <ol class="breadcrumb">
          <li><a href="#"><i class="fa fa-gear"></i> 系统管理</a></li>
          <li class="active">系统设置</li>
      </ol>
    </section>

    <!-- Main content -->
    <section class="content">
        <div class="alert alert-dismissible" role="alert" style="display: none;">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <strong>提示：</strong><span id="msg">消息</span>
        </div>

      <!-- Default box -->
      <div class="box box-info">
          <div class="box-header with-border">
              <h3 class="box-title">系统设置</h3>
          </div>

          <form class="form-horizontal" id="delivery_add" name="delivery_add" method="post" action="<?php echo site_url('System/setting/update');?>">
              <div class="box-body">
                  <div class="nav-tabs-custom" style="margin-bottom: 0; box-shadow: none;">
                      <ul class="nav nav-tabs">
                          <li class="active"><a href="#tab_1" data-toggle="tab">基本信息</a></li>
                          <!--<li><a href="#tab_2" data-toggle="tab">更多资料</a></li>-->
                      </ul>
                      <div class="tab-content">
                          <div class="tab-pane active" id="tab_1">
                              <div class="form-group">
                                  <label for="site_name" class="col-sm-1 control-label">网站名称</label>
                                  <div class="col-sm-4">
                                      <input class="form-control" id="site_name" name="site_name" type="text" placeholder="未设置" value="<?php echo $this->Setting_model->setting_get('site_name');?>">
                                  </div>
                              </div>

                              <div class="form-group">
                                  <label for="page_title" class="col-sm-1 control-label">页面标题</label>
                                  <div class="col-sm-4">
                                      <input class="form-control" id="page_title" name="page_title" type="text" placeholder="未设置" value="<?php echo $this->Setting_model->setting_get('page_title');?>">
                                  </div>
                              </div>

                              <div class="form-group">
                                  <label for="meta_keywords" class="col-sm-1 control-label">关键词</label>
                                  <div class="col-sm-4">
                                      <input class="form-control" id="meta_keywords" name="meta_keywords" type="text" placeholder="未设置" value="<?php echo $this->Setting_model->setting_get('meta_keywords');?>">
                                      <p class="help-block">meta关键词，多个关键词使用英文逗号分隔。</p>
                                  </div>
                              </div>

                              <div class="form-group">
                                  <label for="meta_description" class="col-sm-1 control-label">网站描述</label>
                                  <div class="col-sm-4">
                                      <textarea class="form-control" id="meta_description" name="meta_description" rows="5" placeholder="未设置"><?php echo $this->Setting_model->setting_get('meta_description');?></textarea>
                                      <p class="help-block">meta描述，建议最多不要超过250个字符。</p>
                                  </div>
                              </div>

                              <div class="form-group">
                                  <label for="icp_number" class="col-sm-1 control-label">ICP备案号</label>
                                  <div class="col-sm-4">
                                      <input class="form-control" id="icp_number" name="icp_number" type="text" placeholder="未设置" value="<?php echo $this->Setting_model->setting_get('icp_number');?>">
                                  </div>
                              </div>

                              <div class="form-group">
                                  <label for="count_code" class="col-sm-1 control-label">统计代码</label>
                                  <div class="col-sm-4">
                                      <textarea class="form-control" id="count_code" name="count_code" rows="5" placeholder="未设置"><?php echo $this->Setting_model->setting_get('count_code');?></textarea>
                                      <p class="help-block">第三方网站访问统计代码。</p>
                                  </div>
                              </div>
                          </div>
                          <!-- /.tab-pane -->

                          <!--<div class="tab-pane" id="tab_2">
                          </div>-->
                          <!-- /.tab-pane -->
                      </div>
                      <!-- /.tab-content -->
                  </div>
              </div>

              <div class="box-footer">
                  <button type="submit" class="btn btn-info pull-right">保存</button>
              </div>
          </form>
      </div>
      <!-- /.box -->

    </section>
    <!-- /.content -->
  </div>
  <!-- main end -->
</div>
<!-- ./wrapper -->

</body>
</html>
<!-- jQuery 2.2.3 -->
<script src="<?php echo base_url();?>views/static/plugins/jQuery/jquery-2.2.3.min.js"></script>
<!-- Bootstrap 3.3.6 -->
<script src="<?php echo base_url();?>views/static/bootstrap/js/bootstrap.min.js"></script>
<!-- SlimScroll -->
<script src="<?php echo base_url();?>views/static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
<script src="<?php echo base_url();?>views/static/plugins/layer/layer.js"></script>
<script src="<?php echo base_url();?>views/static/plugins/bootstrapvalidator/js/bootstrapValidator.js"></script>
<script src="<?php echo base_url();?>views/static/plugins/kindeditor/kindeditor-all.js"></script>
<!-- AdminLTE App -->
<script src="<?php echo base_url();?>views/static/dist/js/app.min.js"></script>

<script src="<?php echo base_url();?>views/static/js/my_common.js"></script>

<script>
    $(function() {
        $('#delivery_add').bootstrapValidator({
            message: 'This value is not valid',
            feedbackIcons: {
                valid: 'glyphicon glyphicon-ok',
                invalid: 'glyphicon glyphicon-remove',
                validating: 'glyphicon glyphicon-refresh'
            },
            fields: {
                /*delivery_name: {
                    message: '无效输入',
                    validators: {
                        notEmpty: {
                            message: '配送方式名称不能为空！'
                        }
                    }
                },
                delivery_price: {
                    message: '无效输入',
                    validators: {
                        notEmpty: {
                            message: '运费价格不能为空！'
                        },
                        greaterThan: {
                            value: 0,
                            inclusive: true,
                            message: '运费只允许输入正整数或者小数！'
                        }
                    }
                }*/
            }
        })
            .on('success.form.bv', function(e) {
                e.preventDefault();
                var $form = $(e.target);
                var bv = $form.data('bootstrapValidator');

                $.post($form.attr('action'), $form.serialize(), function(result) {
                    var alertBox = $('.alert');
                    var successClass = 'alert-success',
                        failClass = 'alert-danger';
                    alertBox.find('#msg').html(result['msg']);
                    if (result['status']==1) {
                        alertBox.addClass(successClass).fadeIn(500);

                        setTimeout(function () {
                            window.location.href = location.href;
                        },1500);
                    } else {
                        alertBox.addClass(failClass).fadeIn(500);
                    }
                }, 'json');
            });
    });


</script>
